package jianzhiOffer;


import java.util.HashSet;

//剑指 Offer 03. 数组中重复的数字
public class Num03_findRepeatNumber {
    public int findRepeatNumber(int[] nums) {
        // HashSet
        HashSet<Integer> set = new HashSet<>();
        for (int i:nums){
            if (set.contains(i)){
                return i;
            }
            set.add(i);

        }
        return -1;

    }

}
